package org.metasketch.simulator.resources;

import java.util.HashMap;
import java.util.Map;

public class ResourceRequirementsMap {

	Map<String, ResourceRequirements> requirements = new HashMap<String, ResourceRequirements>();

	public ResourceRequirements addRequirements(String id) {
		ResourceRequirements req = new ResourceRequirements();
		requirements.put(id, req);
		return req;
	}

	public ResourceRequirements getRequirements(String id) {
		ResourceRequirements req = requirements.get(id);
		if (req == null) {
			req = new ResourceRequirements();
			requirements.put(id, req);
		}

		return req;
	}

	public ResourceRequirements getDefaultRequirements() {
		ResourceRequirements req = getRequirements("Default");
		return req;
	}

	public void addRequirement(ResourceBase resourceBase, long amount) {
		ResourceRequirements req = getDefaultRequirements();
		req.addRequirement(resourceBase, amount);
	}

}
